<?php
/**
 * Created by PhpStorm.
 * UsersF: Mloong
 * Date: 2019/4/15
 * Time: 10:45
 */

namespace app\common\model;


use think\Model;

class UsersD extends Model
{
    protected $connection = 'laimibashi_D';
    protected $table = 'users';

    public function UserLoanD()
    {
        return $this->hasOne('UserLoanD', 'users_id');
    }

    /**
     * @param $arr 一组手机号码
     */
    public function getPhoneMoneyDataD($arr, $logo)
    {
        $data = self::with('UserLoanD')
            ->where('company_logo', '=', $logo)
            ->whereIn('phone', $arr)
            ->visible(['id', 'add_time', 'phone', 'user_loan_d', 'user_loan_d.money', 'user_loan_d.loan_day', 'user_loan_d.get_money', 'user_loan_d.status'])
            ->select();
        return $data;
    }
}